import config from "@/config";

export const getLocalLang =()=>localStorage.getItem('system-localLang')||'ch';
export const getApiLang =()=>(getLocalLang()==='ch'?'chi':'eng');
export const getToken =()=>localStorage.getItem('token');
export const setToken =(str)=>localStorage.setItem('token',str);
export const loyout =(str)=>{
  localStorage.removeItem('token');
  location.reload()
};

export const rejuctLocation =()=>{
  
}
export function getBase64(file) {
  return new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = () => resolve(reader.result);
    reader.onerror = error => reject(error);
  });
}
export function getImgFullUrl(url) {
  return config.staticUrl+url
}
